#include<bits/stdc++.h>
using namespace std;
int n;
int cnt[100005];
int pre[100005];
int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    //freopen("./CSP-S/duel/duel1.in", "r", stdin);
    cin >> n;
    while(n--){
        int r;
        cin >> r;
        cnt[r]++;
    }
    for(int i = 1; i <= 100003; i++) pre[i] = cnt[i] + pre[i-1] - min(pre[i-1], cnt[i]);
    cout << pre[100003];
    return 0;
}

